import { get, post } from '@/utils/request'

const prefix = 'rbac'

export default {
  /**
   * 商城链接
   */
  assignment: data => {
    return get(`${prefix}/assignment/index`, data)
  },

  /**
   * 商城链接
   */
  assignmentView: id => {
    return get(`${prefix}/assignment/view`, {
      id: id
    })
  },

  /**
   * 授权
   */
  assign: (id, data) => {
    return post(`${prefix}/assignment/assign?id=${id}`, data)
  },

  /**
   * 移除授权
   */
  revoke: (id, data) => {
    return post(`${prefix}/assignment/revoke?id=${id}`, data)
  }
}
